$OpenBSD: patch-ext_iconv_iconv_c,v 1.2 2015/07/12 14:07:10 robert Exp $
--- ext/iconv/iconv.c.orig.port	Wed Jul  8 16:55:35 2015
+++ ext/iconv/iconv.c	Sun Jul 12 15:58:13 2015
@@ -398,7 +398,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d
 
 			out_p = (d)->c + (d)->len;
 
-			if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
+			if (iconv(cd, (const char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
 #if ICONV_SUPPORTS_ERRNO
 				switch (errno) {
 					case EINVAL:
@@ -585,7 +585,7 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const c
 	out_p = out_buf;
 
 	while (in_left > 0) {
-		result = iconv(cd, (char **) &in_p, &in_left, (char **) &out_p, &out_left);
+		result = iconv(cd, (const char **) &in_p, &in_left, (char **) &out_p, &out_left);
 		out_size = bsz - out_left;
 		if (result == (size_t)(-1)) {
 			if (ignore_ilseq && errno == EILSEQ) {
@@ -710,7 +710,7 @@ static php_iconv_err_t _php_iconv_strlen(unsigned int 
 
 		prev_in_left = in_left;
 
-		if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
+		if (iconv(cd, (const char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
 			if (prev_in_left == in_left) {
 				break;
 			}
@@ -831,7 +831,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pr
 
 		prev_in_left = in_left;
 
-		if (iconv(cd1, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
+		if (iconv(cd1, (const char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
 			if (prev_in_left == in_left) {
 				break;
 			}
@@ -963,7 +963,7 @@ static php_iconv_err_t _php_iconv_strpos(unsigned int 
 
 		prev_in_left = in_left;
 
-		if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
+		if (iconv(cd, (const char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
 			if (prev_in_left == in_left) {
 #if ICONV_SUPPORTS_ERRNO
 				switch (errno) {
@@ -1212,7 +1212,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_st
 
 					out_left = out_size - out_reserved;
 
-					if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
+					if (iconv(cd, (const char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
 #if ICONV_SUPPORTS_ERRNO
 						switch (errno) {
 							case EINVAL:
@@ -1312,7 +1312,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_st
 					out_p = buf;
 					out_left = out_size;
 
-					if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
+					if (iconv(cd, (const char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
 #if ICONV_SUPPORTS_ERRNO
 						switch (errno) {
 							case EINVAL:
@@ -2585,7 +2585,7 @@ static int php_iconv_stream_filter_append_bucket(
 		tcnt = self->stub_len;
 
 		while (tcnt > 0) {
-			if (iconv(self->cd, &pt, &tcnt, &pd, &ocnt) == (size_t)-1) {
+			if (iconv(self->cd, (const char **)&pt, &tcnt, &pd, &ocnt) == (size_t)-1) {
 #if ICONV_SUPPORTS_ERRNO
 				switch (errno) {
 					case EILSEQ:
